//    Copyright (C) Kherty.  All rights reserved.
using System.Collections.Generic;
using OpenLS.Core.Serialization;

namespace OpenLS.Vml.Drawing
{
    internal class Rules : IOfficeXmlSerializable
    {
        readonly List<Rule> _rules = new List<Rule>();
        public void ReadXml(ReadContext context)
        {
            using (var c = context.Read("rules"))
            {
                _rules.Clear();
                _rules.AddRange(c.ReadOptionalWhile<Rule>("r"));
            }
        }

        public void WriteXml(WriteContext context)
        {
            using (var c = context.Write("rules"))
            {
                c.WriteElements(_rules);
            }
        }
    }
}